<?php
namespace Admin\Controller;
use Admin\Controller\BaseController;
class NoticeController extends BaseController{	
	/*
		<code>
			通知列表
		</code>
		
	*/

	public function list_get_json(){
		$map['customerid']=$_SESSION['customer']['id'];
		$res=M('Notice')->where($map)->limit(10)->select();
		if($res){		
			$data=array(
				'error_no'=>10011,
				'msg'=>'获取列表成功',
				'res'=>$res,
				'status'=>1,
			);
		}else{
			$data=array(
				'error_no'=>20011,
				'msg'=>'获取列表失败',
				'res'=>$res,
				'status'=>0,

			);
		}
		$this->Response($data,'json');
	}
	public function view_get_json(){
		$notice=M('Notice');	
		$map['id']=$_GET['id'];
		$res=$notice->where($map)->find();	
		if($res){
			$notice->where($map)->setField(array('status'=>1));
			$data=array(
				'error_no'=>10010,
				'msg'=>'通知详情',
				'res'=>$res,
				'status'=>1,
			);
		}else{
			$data=array(
				'error_no'=>20010,
				'msg'=>'获取失败',
				'status'=>0,
			);
		}
		$this->Response($data,'json');
	}

}